/**
 *---------------------------------------------------------------------------------------------------------------------
 *  @copyright Copyright (c) 2022  <dx_65535@163.com>.
 *
 *  @file       : Property.h
 *  @author     : Xiang.D (dx_65535@163.com)
 *  @version    : 1.0
 *  @brief      : Blog: https://mp.weixin.qq.com/s/eoCPWMGbIcZyxvJ3dMjQXQ
 *  @date       : 2024/04/01
 *
 *
 *  Change History:
 *  <Date>     | <Version> | <Author>       | <Description>
 *---------------------------------------------------------------------------------------------------------------------
 *  2024/04/01 | 1.0.0.1   | Xiang.D        | Create file
 *---------------------------------------------------------------------------------------------------------------------
 *
 */
#ifndef __PROPERTY_H__
#define __PROPERTY_H__

#include <string>

class Property
{
public:
    /**
     * @brief Destructor
     */
    ~Property();

    /**
     * @brief Get the Instance object
     *
     * @return object
     */
    static Property* GetInstance();

    /**
     * @brief SetProperty
     *
     * @param key
     * @param value
     * @return 0 on success, or -1 if an error occurred
     */
    int SetProperty(const std::string& key, const std::string& value);

    /**
     * @brief GetProperty
     *
     * @param key
     * @param value
     * @param defaultValue  The default value is returned when error
     * @return 0 on success, or -1 if an error occurred
     */
    int GetProperty(const std::string& key, std::string& value, const std::string& defaultValue);

    /**
     * @brief GetProperties
     *
     * @return 0 on success, or -1 if an error occurred
     *
     * Dump all properties to logs, only used for debug.
     */
    int GetProperties();

private:
    /**
     * @brief Constructor
     */
    Property();
};

#endif // __PROPERTY_H__
